package Example1;

/**
 * 父类，定义了静态代码块
 */
public class Parent {
    private static Integer staticVar=100;
    public static String publicStaticVar="父类 public静态变量";
    private double price;
    private String name;

    // 普通代码块(一般用来对普通成员变量初始化)
    {
        System.out.println("父类普通代码块执行了");
        price=23.54f;
        name="飘柔";
    }

    static {
        System.out.println("看看父类静态变量是否初始化:"+staticVar+", "+publicStaticVar);
        System.out.println("父类静态代码块执行了");
    }

    public Parent(){
        System.out.println("父类构造方法执行了");
    }

}
